import service from "@/utils/request";
import type { Response, PageResponse } from "@/types/common";
import type { EmployeeItem } from "@/types/person/employee";

// <any, Response<PageResponse<DevPageItem>>>
// <any, Response<EmployeeItem>>
export const usePersonEmployeePageApi = (params: object) => {
  return service<any, Response<PageResponse<EmployeeItem>>>({
    url: `/v1/person/employee/page`,
    method: "GET",
    params,
  });
};

export const usePersonEmployeeQueryApi = (params: object) => {
  return service({
    url: `/v1/person/employee/query`,
    method: "GET",
    params,
  });
};

export const usePersonEmployeeListApi = (params: object) => {
  return service<any, Response<EmployeeItem[]>>({
    url: `/v1/person/employee/list`,
    method: "GET",
    params,
  });
};

export const usePersonEmployeeCreateApi = (data: object) => {
  return service({
    url: `/v1/person/employee/create`,
    method: "POST",
    data,
  });
};

export const usePersonEmployeeUpdateApi = (data: object) => {
  return service({
    url: `/v1/person/employee/update`,
    method: "POST",
    data,
  });
};

export const usePersonEmployeeDeleteApi = (data: object) => {
  return service({
    url: `/v1/person/employee/delete`,
    method: "DELETE",
    data,
  });
};

export const usePersonEmployeeHardDeleteApi = (data: object) => {
  return service({
    url: `/v1/person/employee/hardDelete`,
    method: "DELETE",
    data,
  });
};

export const usePersonRecoverEmployeePageApi = (params: object) => {
  return service<any, Response<PageResponse<EmployeeItem>>>({
    url: `/v1/person/employee/recoverPage`,
    method: "GET",
    params,
  });
};

export const usePersonEmployeRecoverApi = (params: object) => {
  return service({
    url: `/v1/person/employee/recover`,
    method: "GET",
    params,
  });
};
